
/*
 *  This is the SmartCar Standing Code;
 *  Copyright (C) 2011-2012 WenX, SEU, P.R.China <wenxiao1992@gmail.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 
#ifndef WENX_CONST_H
#define WENX_CONST_H

float TSPDA,TSPDB,TSPD;

const unsigned int LOWBATTARY = 6140;         //7.5V
const unsigned int LOWBATTARY_ONGOING = 5710; //7.0V

const unsigned int PAUSE_ROUND = 500;
unsigned int PAUSEMODE=0;
float TargetSPD=2000;

float DC1,DC2,DC3;

unsigned int RTICounter;
const unsigned int RTICounterMAX=50;

int Degree_Distance_MID;

int TTargetSPD;
int TEST_SOLVE_CT=0;
int TEST_AD_CT=0;
int lastdelta;
int SPDACC;
float This_offset,Pre_Control_Speed,Control_Speed;
float Pre_offset;
float DCOffset,DCOffset_P,DCOffset_D;
float MAXOFFSET,DC_Control;;

const float Offset_P=0.0034;
const float Offset_D=0.0058;

float Omi_SPD0,Omi_SPD1;

float TSPDA,TSPDB,TSPD;

//#define SHOW_Cesu
//#define SHOW_Degree

#define NOTREADY() (PAUSEMODE<=PAUSE_ROUND)
#define READY() (PAUSEMODE>PAUSE_ROUND)

#endif